<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改列字段的验证规则')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-rules-edit" th:object="${dynamicColumnRules}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否必填(1是)：</label>
                <div class="col-sm-8">
                    <input name="isRequired" th:field="*{isRequired}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证数字(1是)：</label>
                <div class="col-sm-8">
                    <input name="isNumber" th:field="*{isNumber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证整数(1是)：</label>
                <div class="col-sm-8">
                    <input name="isInteger" th:field="*{isInteger}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">验证最小值(1是)：</label>
                <div class="col-sm-8">
                    <input name="minValue" th:field="*{minValue}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">验证最大值(1是)：</label>
                <div class="col-sm-8">
                    <input name="maxValue" th:field="*{maxValue}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是邮箱(1是)：</label>
                <div class="col-sm-8">
                    <input name="isEmail" th:field="*{isEmail}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是否是有效的网址(1是)：</label>
                <div class="col-sm-8">
                    <input name="isUrl" th:field="*{isUrl}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是日期(1是)：</label>
                <div class="col-sm-8">
                    <input name="isDate" th:field="*{isDate}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否验证是时间(1是)：</label>
                <div class="col-sm-8">
                    <input name="isTime" th:field="*{isTime}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">自定义的验证函数：</label>
                <div class="col-sm-8">
                    <input name="func" th:field="*{func}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: bootstrap-table" />
    <script th:inline="javascript">
        var prefix = ctx + "dynamic/rules";
        $("#form-rules-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-rules-edit').serialize());
            }
        }
    </script>
</body>
</html>